package com.ruoyi.app.service.impl;


import com.ruoyi.app.domain.InpatientRegister;
import com.ruoyi.app.domain.vo.InpatientRegisterVo;
import com.ruoyi.app.mapper.InpatientRegisterMapper;
import com.ruoyi.app.mapper.PatientMapper;
import com.ruoyi.app.service.InpatientRegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 75460
* @description 针对表【inpatient_register(住院登记表)】的数据库操作Service实现
* @createDate 2025-05-14 14:21:37
*/
@Service
public class InpatientRegisterServiceImpl implements InpatientRegisterService {
    @Autowired
    private InpatientRegisterMapper inpatientRegisterMapper;
    @Autowired
    private PatientMapper  patientMapper;
    @Override
    public List<InpatientRegister> getList(Integer userId) {
        return inpatientRegisterMapper.getList(userId);
    }

    @Override
    public List<InpatientRegister> getListBy(String inpatientNo) {
        return inpatientRegisterMapper.getListBy(inpatientNo);
    }

    @Override
    public InpatientRegisterVo select(String inpatientNo) {

        InpatientRegisterVo vo = inpatientRegisterMapper.select(inpatientNo) ;
//        System.err.println("ServiceImpl 层:"+vo);
        String patientName = patientMapper.selectById(vo.getPatientId());
        vo.setPatientName(patientName);
        return vo;
    }
}




